home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / x11 / xbattle.pat / xbattle.patch
Text File  |  1995-01-02  |  2KB  |  59 lines

  1. For some reason xbattle seems to croak at the __asm__ line for FD_SET in
  2. the <linux/types.h> file.  I found an alternate definition for FD_SET, etc in 
  3. <gnu/types.h> and made a patch to have the compiler use these instead.  I
  4. admit not really knowing much about why it fails without the patch, but it
  5. compiles rather cleanly with it.
  6.  
  7. Don't worry, this only changes main.c, not <linux/types.h>.  ;)
  8.  
  9. darron@griffin.sccsi.com
  10.  
  11. *** main.c.orig    Sun Sep 27 11:52:19 1992
  12. --- main.c    Mon Jan  2 18:47:02 1995
  13. ***************
  14. *** 12,21 ****
  15. --- 12,54 ----
  16.   #if UNIX
  17.   #include <sys/types.h>
  18.   #include <sys/time.h>
  19.   #endif
  20.   
  21. + /*********************************/
  22. + /* Patches to compile from linux */
  23. + #undef __FD_SETSIZE
  24. + #define __FD_SETSIZE    256
  25. + /* It's easier to assume 8-bit bytes than to get CHAR_BIT.  */
  26. + #undef __NFDBITS
  27. + #define __NFDBITS       (sizeof(unsigned long int) * 8)
  28. + #undef __FDELT(d)
  29. + #define __FDELT(d)      ((d) / __NFDBITS)
  30. + #undef __FDMASK(d)
  31. + #define __FDMASK(d)     (1 << ((d) % __NFDBITS))
  32. + typedef struct
  33. + {
  34. +   unsigned long int fds_bits [(__FD_SETSIZE + (__NFDBITS - 1)) / __NFDBITS];
  35. + } __fd_set;
  36. + /* This line MUST be split!  Otherwise m4 will not change it.  */
  37. + #undef  __FD_ZERO(set)
  38. + #define __FD_ZERO(set)  \
  39. +     ((void) memset((__ptr_t) (set), 0, sizeof(fd_set)))
  40. + #undef  __FD_SET
  41. + #define __FD_SET(d, set)        ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
  42. + #undef  __FD_CLR
  43. + #define __FD_CLR(d, set)        ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
  44. + #undef  __FD_ISSET
  45. + #define __FD_ISSET(d, set)      ((set)->fds_bits[__FDELT(d)] & __FDMASK(d))
  46. + /* End linux patches             */
  47. + /*********************************/
  48.   /*************************************************************************/
  49.   /**    xbattle                                **/
  50.   /**                                    **/
  51.   /**    Steve Lehar (slehar@park.bu.edu)                **/
  52.   /**     Greg Lesher (lesher@park.bu.edu)                **/
  53.